<link rel="stylesheet"
	href="./app/lib/datetimepicker/css/bootstrap-datetimepicker.min.css">

<section class="content-header">
	<h1>
		{{title}}<small></small>
	</h1>
</section>
<section class="content">
	<div class="box box-default">
		<div class="col-md-12">
			<div class="box-body" ng-controller="advertise">
				<alertdanger></alertdanger>
				<alertsuccess></alertsuccess>
				<form role="form" >
					<div class="box-body">
						<div class="form-group">
							<label>广告说明</label> <input maxlength="20" required="required" ng-model="alt"
								class="form-control" type="text" placeholder="请输入广告说明" value="">
						</div>
						<div class="form-group">
							<label>广告链接</label> <input maxlength="20" required="required" ng-model="href"
								class="form-control" type="text" placeholder="请输入广告链接" value="">
						</div>
						<div class="form-group">
							<label>展示位置标记</label> <input maxlength="20" required="required" ng-model="showTag"
								class="form-control" type="text" placeholder="请输入展示位置标记首页广告请使用homepage做标示" value="">
						</div>
						<div class="form-group">
							<label>广告时效</label>
							<div class="control">
								<label> <input type="radio" ng-model="showtype" ng-change="showtypechange();"
									ng-value="0" class="flat-red" ng-checked="true">短期&nbsp;&nbsp;&nbsp;
								</label> <label> <input type="radio" ng-model="showtype" ng-change="showtypechange();"
									ng-value="1" class="flat-red">永久
								</label>
							</div>
						</div>
						<div class="form-group" ng-show="reservationtimeshow">
		                    <label>广告持续时间段:</label>
		                    <div class="input-group">
		                      <div class="input-group-addon">
		                        <i class="fa fa-clock-o"></i>
		                      </div>
		                      <input type="text" class="form-control pull-right" ng-model="reservationtime" id="reservationtime">
		                    </div>
	                  	</div>
                  
						
						<div class="form-group">
							<label>广告高度</label> <input maxlength="20" required="required" ng-model="height"
								class="form-control" type="number" placeholder="请输入广告高度" value="">
						</div>
						<div class="form-group">
							<label>广告宽度</label> <input maxlength="20" required="required" ng-model="width"
								class="form-control" type="number" placeholder="请输入广告宽度" value="">
						</div>
						
						<div class="form-group">
							<label>展现位置</label>
							<div class="control">
								<label> <input type="radio" ng-model="showWhere"
									ng-value="3" class="flat-red" ng-checked="true">所有&nbsp;&nbsp;&nbsp;
								</label> <label> <input type="radio" ng-model="showWhere"
									ng-value="1" class="flat-red">移动平台&nbsp;&nbsp;&nbsp;
								</label> <label> <input type="radio" ng-model="showWhere"
									ng-value="2" class="flat-red">Web平台
								</label>
							</div>
						</div>
						<div class="form-group">
							<label>标记码</label> <input maxlength="20" required="required" ng-model="code"	
								class="form-control" type="text" placeholder="请输入标记码" value="">
						</div>
						
						
						<div class="form-group">
							<label>广告形式</label>
							<div class="control">
								<label> <input type="radio" ng-model="type"
									ng-value="1" class="flat-red">二维码&nbsp;&nbsp;&nbsp;
								</label> <label> <input type="radio" ng-model="type"
									ng-value="2" class="flat-red" ng-checked="true">图片
								</label>
							</div>
						</div>
						<div class="form-group">
							<label>图片</label>
							<div ngf-drop ngf-select ng-model="files" class="drop-box"
								ngf-drag-over-class="'dragover'" ngf-multiple="true"
								ngf-allow-dir="true" accept="image/*" ngf-pattern="'image/*'">
								<button class="btn btn-default btn-block btn-sm">选择文件</button>
								<div ngf-no-file-drop>File Drag/Drop is not supported for
									this browser</div>
							</div>
							<div class='box-body'>
								<div class="progress progress-sm active">
									<div
										class="progress-bar progress-bar-success progress-bar-striped"
										role="progressbar" aria-valuenow="0" aria-valuemin="0"
										aria-valuemax="100" style="width: {{progress}}%">
										<span class="sr-only">20% Complete</span>
									</div>
								</div>
								<div ng-repeat="img in allupimgs">
									<div ng-if="img.isCloudImg">
										<div class="alert alert-success alert-dismissable">
											<button ng-click="remove($index)" type="button" class="close"
												data-dismiss="alert" aria-hidden="true">&times;</button>
											
											<img class="img-responsive pad"
												ng-src="{{img.normalfilepath}}" alt="Photo"> <img
												class="img-responsive pad" ng-src="{{img.compressfilepath}}"
												alt="Photo">

										</div>
									</div>
									<div ng-if="!img.isCloudImg">
										<div class="alert alert-success alert-dismissable">
											<button ng-click="remove($index)" type="button" class="close"
												data-dismiss="alert" aria-hidden="true">&times;</button>
											
											<img class="img-responsive pad"
												ng-src="{{img.basepath+img.normalfilepath}}" alt="Photo">

											<img class="img-responsive pad"
												ng-src="{{img.basepath+img.compressfilepath}}" alt="Photo">

										</div>
									</div>
								</div>
							</div>
						</div>
						<div class="form-group">
							<label>排序</label> <input maxlength="20" required="required" ng-model="sort"
								class="form-control" type="number" placeholder="请输入排序" value="">
						</div>
						<div class="form-group">
		                    <label>
		                      <input type="radio" ng-model="status" ng-value="1" class="flat-red" ng-checked="true">
		                      启用
		                    </label>
		                    <label>
		                      <input type="radio"  ng-model="status" ng-value="0" class="flat-red">
		                      禁用
		                    </label>
		               
	                  	</div>
					</div>
					<div class="box-footer">
						<button ng-show="savebtn.show"type="button" class="btn btn-primary" ng-click="save();">保存</button>
						<button ng-show="updatebtn.show" type="button" class="btn btn-primary" ng-click="update();">更新</button>
					</div>
				</form>
			</div>
		</div>
		<div class="box-footer"></div>
	</div>
</section>
<script>
$(function(){
   $('#reservationtime').daterangepicker({timePicker: true, timePickerIncrement: 30, format: 'YYYY/MM/DD h:mm:ss'});
  // $('#reservationtime').daterangepicker({singleDatePicker: true, showDropdowns:true, format: 'YYYY/MM/DD'});

    
});
</script>